#ifndef __LDX_CSCENENODEMANIMATORFLYCIRCLE_H_INCLUDE__
#define __LDX_CSCENENODEMANIMATORFLYCIRCLE_H_INCLUDE__
#include "ISceneNodeAnimator.h"
#include "LDXConfig.h"

namespace ldx
{
	namespace scene
	{
		class CSceneManager;
		class CSceneNodeAnimatorFlyCircle : public ISceneNodeAnimator
		{
		public:

			//! constructor
			CSceneNodeAnimatorFlyCircle(float time,
				const mt::vec3f& center, float radius,
				float speed, const mt::vec3f& direction,
				float radiusEllipsoid);

			//! animates a scene node
			virtual void animateNode(ISceneNode* node, float timeMs) override;

			//! Returns type of the scene node animator
			virtual ESCENE_NODE_ANIMATOR_TYPE getType() const { return ESNAT_FLY_CIRCLE; }

			//! Creates a clone of this animator.
			/** Please note that you will have to drop
			(IReferenceCounted::drop()) the returned pointer after calling
			this. */
			virtual ISceneNodeAnimator* createClone(ISceneNode* node, CSceneManager* newManager = 0);

		private:
			// do some initial calculations
			void init();

			// circle center
			mt::vec3f Center;
			// up-vector, normal to the circle's plane
			mt::vec3f Direction;
			// Two helper vectors
			mt::vec3f VecU;
			mt::vec3f VecV;
			float Radius;
			float RadiusEllipsoid;
			float Speed;
			float StartTime;
		};


	}
}
#endif